-
Notifications
You must be signed in to change notification settings - Fork 188
worker/: fix worker stuck in unitTransWaitCondition #589
Conversation
Codecov Report
@@ Coverage Diff @@
## master #589 +/- ##
================================================
+ Coverage 57.8518% 58.1985% +0.3466%
================================================
Files 201 201
Lines 20371 20461 +90
================================================
+ Hits 11785 11908 +123
+ Misses 7455 7417 -38
- Partials 1131 1136 +5 |
if err != nil { | ||
st.l.Error("wait condition", log.ShortError(err)) | ||
st.fail(err) | ||
return | ||
} else if ctx.Err() != nil { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the stage keep as Stage_Running
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.Err() != nil
means this context is canceled in other go routine, that go routine will change the stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, how about checking the stage in the unit test cases?
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cherry pick to release-1.0 failed |
@lichunzhu please do not forget to cherry-pick it manually. |
@csuzhangxc OK |
What problem does this PR solve?
#576
When subtask is started, it will use
unitTransWaitCondition
to wait for relay log to catch up. But if this task is paused or stopped, we should quit as fast as we can instead of keeping waiting.What is changed and how it works?
st.currCtx
to control wait ofunitTransWaitCondition
.st.ctx
and son contextst.currCtx
to make sure task can be shut down.Check List
Tests
Related changes